package net.lanelife.casino.caipiao.service;

import net.lanelife.casino.caipiao.entity.Preference;
import net.lanelife.casino.caipiao.repository.api.IPreferenceRepository;
import net.lanelife.casino.caipiao.service.api.IPreferenceService;
import net.lanelife.casino.common.repository.support.GenericRepository;
import net.lanelife.casino.common.service.support.GenericService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class PreferenceService extends GenericService<Preference, Integer> implements IPreferenceService {

	@Autowired
	private IPreferenceRepository repository;
	
	public PreferenceService() {
		super(Preference.class);
	}
	
	@Override
	protected GenericRepository<Preference, Integer> getRepository() {
		return repository;
	}
	
	@Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
	public Preference find(String code) {
		return repository.findByCode(code);
	}


}
